#Demo11-1.ps1
#Utilisation d'un objet renderer coupl? ? un appender SMTP 

$LogMail.Logger.Parent.Appenders[0].Subject="[$env:COMPUTERNAME]Fatal Error in $($MyInvocation.InvocationName) script."

$RndrPath=$Pwd
 # charge la librairie PSLog4NET (Renderer)
[Reflection.Assembly]::LoadFrom("$RndrPath\PSLog4NET.dll")

$PSRenderer = new-object PSLog4NET.PSObjectRenderer
$Repository = [log4net.LogManager]::GetRepository()
$Repository.RendererMap.Put([PSLog4NET.PSObjectRenderer],(new-object PSLog4NET.PSObjectRenderer) )
. .\PackageDebugTools.ps1
$PSRenderer|Add-Member -Force -MemberType ScriptMethod ToString { rver|Out-String }
 #D?clenche une erreur
.\Demo11-1Error.ps1


